package com.imooc.module.reponse;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;
import java.util.List;

@Data
@NoArgsConstructor
public class AssetDataResponse implements Serializable {

    private static final long serialVersionUID = 1L;

    private List<Rule> rules;

    @Data
    @NoArgsConstructor
    @AllArgsConstructor
    public static class Rule {
        // 规则ID
        private String ruleId;

        //业务
        private String businessName;

        //规则名称
        private String ruleName;

        //指标信息
        private List<MetaData> metaDatas;

        @Data
        @NoArgsConstructor
        @AllArgsConstructor
        public static class MetaData {
            // 指标主键ID
            private Long id;

            // 指标中文标识
            private String cnName;

            //指标计算表达式。如果是直接通过数据库采集的，这个字段为空
            private String expression;

            // 当前指标是否和维度有关
            private Boolean dimension;

            // 当前指标是否和统计周期有关
            private Boolean period;

            // 指标数据类型
            private String dataType;

            // 指标描述
            private String description;

            //采集数据源
            public String collectDataSource;
        }
    }

}